version 9
capture log close
*
set more off
*
log using MangerWP10-2012-Appendix, replace text
use MangerWP10-2012.dta, clear
tsset, clear

*********************** This file produces the various robustness checks shown in the web appendix
*
*
*
*********************** Drop different countries from the sample
* Perhaps the results are driven only by the EU? Also, some people might think that it's incorrect to treat the EU as one "country"
* in the analysis. Hence we re-run the analysis and exclude all dyads with the EU as one of the partners.
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1 & iso1 != "EUR", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatnoEU
label var zhatnoEU "predicted share of VIIT, 25% uv"
*
* 
logit anyPTAinforce zhatnoEU lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1 & iso1 != "EUR", vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo noEU, title((10)) 
*
*
* Alternatively, we might argue that the US policy change to pursue North-South PTAs might have triggered a global movement towards 
* such agreements. Hence we re-run the analysis and exclude all dyads with the USA as one of the partners.
* 
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1 & iso1 != "USA", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatnoUS
label var zhatnoUS "predicted share of VIIT, 25% uv"

logit anyPTAinforce zhatnoUS lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1 & iso1 != "USA", vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo noUS, title((11))
*
*
* Some "Northern" countries are mainly natural resource exporters (Australia, Canada, New Zealand and Norway). We can also drop those.
*
*
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1 & iso1 !="AUS" & iso1 !="CAN" & iso1 !="NZL" & iso1 != "NOR", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
*
*
predict zhatCairns
logit anyPTAinforce zhatCairns lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth if fullsample==1 & iso1 !="AUS" & iso1 !="CAN" & iso1 !="NZL" & iso1 !="NOR", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
eststo noResources, title((12))
*
* The results are similar. 
*
* Some would argue that Korea is misclassified and should really counted as a capital-exporting developed country, and that Singapore is a special case
*
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1 & iso1 !="KOR" & iso1 !="SGP", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatKORGSP
logit anyPTAinforce zhatKOR lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth if fullsample==1 & iso1 !="KOR" & iso1 !="SGP", vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
*
eststo noKORSGP, title((13))
* Again, nothing very different except that the Democracy North variable is dropped because it doesn't have any variation in the sample (always 10)
* Finally we can restrict the sample by excluding all "developing" countries that have * a capital-to-worker ratio of less than 5,000 in the year 2000, thereby excluding
* most least-developed countries. Furthermore, we can exclude all countries classified
* as developing, but actually extremely capital-intensive exporters of natural
* resources such as oil and gas, with a capital-to-worker ratio of over 50,000. 

reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1 & kpw2 < 50000 & kpw2 > 5000, vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatkpw
logit anyPTAinforce zhatkpw lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth if fullsample==1 & kpw2 < 50000 & kpw2 > 5000, vce(bootstrap, cluster(pairid) reps(1000) seed(123))

eststo kpw, title((13a))
estout noEU noUS noResources noKORSGP using MangerVIIT-PTAs-RnR-appendix1.tex, replace cells("b se") style(mytex_logit) legend nolabel

*
*********************** Signature instead of ratification
*
* We could also conjecture that the date of PTA signature matters rather than the actual ratification. In the following analysis, 
* the dependent variable is 1 if a new PTA is signed between the two countries in that year. As before, the dyad is subsequently
* dropped from the analysis.
*
* use PTA signature instead of ratification
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1, vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict viit25sharehat
label var viit25sharehat "predicted share of VIIT, 25% uv"
*
*
logit anyPTAsigned viit25sharehat lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround  lnGDPcapNorth lnGDPcapSouth tradecoverageanyPTANorth tradecoverageanyPTASouth  if oldPTAsigned !=2 & fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo logitsign, title((14))
*


*********************** The IV approach requires strong assumptions about the instruments. A comparison with a single-equation approach that ignores the *********************** selection effect is therefore useful
*
* Standard OP: cubic splines to control for duration dependence according to Beck, Katz and Tucker (1998). Splines generated with the btscs.do file	
btscs anyPTAinforce year pairid if fullsample==1, g(noPTAyear) nspline(3)
logit anyPTAinforce viitShare25  lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth _spline* if fullsample==1
eststo cubicsplines, title((15))

* Compare this with a single-equation model with panel-bootstrapped standard errors
logit anyPTAinforce viitShare25  lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo singleeq, title((16))

* Now test the exclusion restriction by including the residual from the first stage
* in the second-stage equation. If it were to be significant, the residuals wouldn't be orthogonal to the dependent variable.
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _Iyear* if fullsample==1, vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatresid
label var viit25sharehat "predicted share of VIIT, 25% uv"
predict stage1resid, r
label var stage1resid "residual of 1st stage"
* *
* second stage to predict PTA formation
logit anyPTAinforce zhatresid lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth stage1resid if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo residuals, title((17))
*
* Including these shows that they are not significant, so there is no evidence that the residuals are not orthogonal to the dependent variable.
*
* We can also include the remaining trade (OWT and HIIT)
*
logit anyPTAinforce viit25sharehat lnothertrade25 lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo remainingtrade, title((18))
*

estout kpw remainingtrade logitsign cubicsplines  using MangerVIIT-PTAs-RnR-appendix2.tex, replace cells("b se") style(mytex_logit) legend nolabel drop(_spline*)

*********************** Opinions differ about how to best specify a gravity-type model (see e.g. Matyas 1997, 1998)
*
* We can also include country dummies in the first stage
xi i.iso1 i.iso2 i.year
reg viitShare25 lndistance lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1, vce(bootstrap, reps(1000) cluster(pairid) idcluster(newid) group(pairid) seed(123))
predict zhatcountryfe
logit anyPTAinforce zhatcountryfe lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo ctydummies, title((19))

* This changes nothing about the substantive result either
*
*
************************ Estimate with dyad-specific fixed effects in the first stage
* WARNING! This may take a long time to estimate depending on your computer's memory
set matsize 10000
xi i.pairid i.year
reg viitShare25 lnGdpProd lnGdpCapProd lnFdiProd  _I* if fullsample==1
predict zhatdyadfe
logit anyPTAinforce zhatdyadfe lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo dyaddummies, title((20))
*
* The coefficients are overall smaller, but the conclusion is the same. 
* We can also use the within estimator in the first stage to avoid dealing with all the dummy variables
*
set matsize 500
*
tsset pairid year
xtreg viitShare25 lnGdpProd lnGdpCapProd lnFdiProd if fullsample==1, fe
predict zhatwithin
tsset, clear
logit anyPTAinforce zhatwithin lndistance democNorth_t democSouth_t alliance_t gattwtomemb_t mtnround lnGDPcapNorth lnGDPcapSouth  tradecoverageanyPTANorth tradecoverageanyPTASouth  if fullsample==1, vce(bootstrap, cluster(pairid) reps(1000) seed(123))
eststo within, title((21))
*
* Again nothing is appreciably changed.
*
*
*
estout residuals ctydummies dyaddummies within using MangerVIIT-PTAs-RnR-appendix3.tex, replace cells("b se") style(mytex_logit) legend nolabel
*
*
*
*
log close